<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <wx-box>
        <template v-slot:header>
          <button>1234</button>                
        </template>  
        <template v-slot:div>
          <button>中间</button>                           
        </template>
        <template v-slot:default>
          <button>匿名</button>                           
        </template>
        <template v-slot:footer>
          <button>尾部</button>                           
        </template>  
      </wx-box>
    </div>

    <template id="box">
      <div style="background-color: red; width: 200px; height: 200px">
        <header>
          <slot name="header">头</slot>
        </header>
        <div><slot >中1</slot></div>
        <div><slot name="div">中</slot></div>
        <footer><slot name="footer">尾</slot></footer>
      </div>
    </template>

    <script src="../js/vue.js"></script>

    <script>
      const Box = {
        template: "#box",
      };
      const app = Vue.createApp({
        data() {
          return {
            msg: "",
          };
        },
        components: {
          "wx-box": Box,
        },
      }).mount("#app");
    </script>
  </body>
</html>
